<?php
	if (isLoggedIn()) {
		$user = new FantasyUser($_SESSION['bl_user_id']);
	}
	else {
		$user = new FantasyUser();
	}	
	
	$user->getSeasonRoster();	// punimo postave
	$user->getAllStats();		// punimo statistiku
	$user->calculateTotalPoints();
	
	// podaci
	$k = $settings->currentRound;
	
?>                

            <div class="twoCollumns">
            	<div class="leftCollumn">
                	<div class="leftBox">
                    	<div class="articleHolder">
				<?php
                    if (!isLoggedIn()) {
						if (isset($_GET['id'])) {
							echo "<p class='errorMessage'>";
							switch($_GET['id']) {
								case 1: echo "That username already exists!"; break;
								case 2: echo "Wrong password!"; break;
								case 3: echo "Wrong username!"; break;
								default: echo "There was some error. Please try again!"; break;
							}
							echo "</p>";
						}
                ?>
                
                    	<h3>Welcome to BasketLiga virtual games</h3>
            
                        <p>Have an account? Use the login box on the right side to get access to your team.</p>
                    	<p>If you are a new user, use the register box on the right side to create a new account.</p>
                        <p>
                        After you register, you will get access to Fantasy and Prediction games. 
                        A random Fantasy team will be generated for you, and you can continue making changes.
                        </p>
                        <p>
                        You can also read the Rules to get better understanding of game engine.
                        </p>

				<?php
                    }
                    else {
                ?>
                	<p>Choose the game to start playing:</p>
                    <ul>
                    	<li><a href="<?= $settings->base; ?>fantasy">Fantasy Basketball</a></li>
                        <li><a href="<?= $settings->base; ?>prediction">Prediction Game</a></li>
                    </ul>
                <?php } ?>
                
                        </div>
                    </div>
                </div>
                
                <div class="rightCollumn">
					<?php include ("components/userbox.php"); ?>
                </div>
            </div><!-- end of middle_content -->